var express=require('express')
var { expressjwt } = require('express-jwt')
var app=express()
app.use(express.static('static'))
app.use(express.json())
app.use(express.urlencoded({extended:false}));
app.use(expressjwt({
   secret:"1234",
   algorithms:["HS256"]
}).unless({path:["/user/login","/user/register"]})
)
var userRouter=require("./router/userRouter")
var goodRouter=require('./router/goodRouter')


app.use('/user',userRouter)
app.use('/good',goodRouter)
app.listen(8080,()=>{
   console.log("服务器运行在:http://localhost:8080")
})
